package org.aj.web.exception.prop;

import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.time.Duration;

/**
 * description 告警相关配置
 *
 * @author aj
 * date 2024/10/27 18:29
 */
public class AlarmProperties {

    /**
     * 单个uri连续发送邮件最大次数，默认为5
     */
    private Integer sendMaxCount =5;


    /**
     * 间隔多久进行第二轮邮件发送
     */
    private Duration sendInterval = Duration.ofHours(2);

    /**
     * 使用异步发送邮件的线程池的名称 须是java.util.concurrent.Executor 之类
     */
    private String alarmThreadPoolExecutorBeanName;

    @NestedConfigurationProperty
    private MailProperties mailProperties;


    public Integer getSendMaxCount() {
        return sendMaxCount;
    }

    public void setSendMaxCount(Integer sendMaxCount) {
        this.sendMaxCount = sendMaxCount;
    }

    public Duration getSendInterval() {
        return sendInterval;
    }

    public void setSendInterval(Duration sendInterval) {
        this.sendInterval = sendInterval;
    }

    public String getAlarmThreadPoolExecutorBeanName() {
        return alarmThreadPoolExecutorBeanName;
    }

    public void setAlarmThreadPoolExecutorBeanName(String alarmThreadPoolExecutorBeanName) {
        this.alarmThreadPoolExecutorBeanName = alarmThreadPoolExecutorBeanName;
    }

    public MailProperties getMailProperties() {
        return mailProperties;
    }

    public void setMailProperties(MailProperties mailProperties) {
        this.mailProperties = mailProperties;
    }
}
